<template>
  <div class="app-container">
    <div class="query">
      <el-input v-model="queryByID" placeholder="输入用手机号" clearable />
      <el-input v-model="queryByID" placeholder="输入用户昵称" clearable />
      <el-button type="primary">搜索</el-button>
    </div>
    <el-table
      v-loading="listLoading"
      :data="list"
      element-loading-text="Loading"
      border
      fit
      highlight-current-row
    >
      <el-table-column align="center" label="用户ID" width="95">
        <template #default="scope">
          {{ scope.row.user_id }}
        </template>
      </el-table-column>
      <el-table-column label="用户名">
        <template #default="scope">
          {{ scope.row.user_name }}
        </template>
      </el-table-column>
      <el-table-column label="用户账号">
        <template #default="scope">
          {{ scope.row.user_phone }}
        </template>
      </el-table-column>
      <!-- <el-table-column label="用户密码" align="center">
        <template #default="scope">
          <span>{{ scope.row.user_password }}</span>
        </template>
      </el-table-column> -->
      <el-table-column label="地址" align="center">
        <template #default="scope">
          {{ scope.row.address }}
        </template>
      </el-table-column>
      <el-table-column
        align="center"
        prop="created_at"
        label="创建时间"
        width="200"
      >
        <template #default="scope">
          <i class="el-icon-time" />
          <span>{{ scope.row.time }}</span>
        </template>
      </el-table-column>
      <el-table-column class-name="status-col" label="操作" align="center">
        <template #default="scope">
          <el-button type="text">查看详情</el-button>
          <el-button type="text">禁用账号</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination layout="prev, pager, next" :total="list.length" />
    <el-dialog title="禁用账号" :v-model="dialogFormVisible">
      <el-form :model="form">
        <el-form-item label="禁用时间" :label-width="formLabelWidth">
          <el-date-picker
            v-model="date"
            type="datetime"
            placeholder="选择日期时间"
            default-time="12:00:00"
          />
        </el-form-item>
      </el-form>
      <template #footer>
      <span class="dialog-footer">
        <el-button @click="dialogVisible = false">取消</el-button>
        <el-button type="primary" @click="dialogVisible = false">
          确定
        </el-button>
      </span>
    </template>
    </el-dialog>
  </div>
</template>
  
  <script setup>
//   import { getList } from '@/api/table'

import { reactive,ref } from "vue"

  

    // filters() {
    //   statusFilter(status) {
    //     const statusMap = {
    //       published: 'success',
    //       draft: 'gray',
    //       deleted: 'danger'
    //     }
    //     return statusMap[status]
    //   }
const dialogFormVisible=ref(false)
const list=reactive([
          {
            user_id: 111,
            user_name: '一个同学',
            user_phone: '15288396213',
            user_password: '11312',
            time: '2020-11-14',
            address: '广西大学'
          },
          {
            user_id: 112,
            user_name: '某某',
            user_password: '192u4782',
            user_phone: '1513232842',
            time: '2020-11-14',
            address: '广西大学'
          },
          {
            user_id: 113,
            user_name: '壕',
            user_password: 'xykb284766',
            user_phone: '15166672653',
            sell: '某某',
            time: '2020-11-14',
            address: '广西大学'
          }
        ])
        const date=ref('') 

      // fetchData=()=> {
      //   this.listLoading = true
      //   getList().then(response => {
      //     this.list = response.data.items
      //     this.listLoading = false
      //   })
      // }
  </script>
  <style scoped lang="scss">
.query {
  display: flex;
  justify-self: start;
  margin-bottom: 20px;
  .el-input {
    margin-right: 20px;
    width: 30%;
  }
  .el-select {
    margin-right: 20px;
  }
}
</style>
  